﻿#pragma once

#include "../../MirControls/MirImageControl.h"
#include "../../MirControls/MirLabel.h"
#include "../../MirControls/MirButton.h"
#include "../../MirControls/MirItemCell.h"
#include "../../MirControls/MirControl.h"
#include <vector>
#include <any>

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirObjects;
using namespace Client::MirSounds;
namespace C = ClientPackets;
namespace S = ServerPackets;

namespace Client::MirScenes::Dialogs
{
    class FishingDialog final : public MirImageControl
    {
    public:
        MirLabel *TitleLabel;
        MirButton *CloseButton;
        std::vector<MirItemCell*> Grid;

        MirControl *FishingRod;

        virtual ~FishingDialog()
        {
            delete TitleLabel;
            delete CloseButton;
            delete FishingRod;
        }

        FishingDialog();

    private:
        void FishingDialog_BeforeDraw(std::any sender, EventArgs *e);

        void FishingRod_BeforeDraw(std::any sender, EventArgs *e);

    public:
        void Show() override;

        MirItemCell *GetCell(unsigned long long id);
    };
    class FishingStatusDialog final : public MirImageControl
    {
    public:
        MirImageControl *TitleLabel, *AutoCastBox, *ESCTick, *ESCExit, *FishDisableButton;
        MirControl *ChanceBar, *ProgressBar;
        MirLabel *ChanceLabel;
        MirButton *CloseButton, *AutoCastButton, *FishButton, *ESCExitButton;

        int ChancePercent = 0, ProgressPercent = 0;

    private:
        bool _canAutoCast = false;
        bool _autoCast = false;
    public:
        bool bEscExit = false;

        virtual ~FishingStatusDialog()
        {
            delete TitleLabel;
            delete AutoCastBox;
            delete ESCTick;
            delete ESCExit;
            delete FishDisableButton;
            delete ChanceBar;
            delete ProgressBar;
            delete ChanceLabel;
            delete CloseButton;
            delete AutoCastButton;
            delete FishButton;
            delete ESCExitButton;
        }

        FishingStatusDialog();

    private:
        void FishingStatusDialog_BeforeDraw(std::any sender, EventArgs *e);

        void ChanceBar_BeforeDraw(std::any sender, EventArgs *e);

        void ProgressBar_BeforeDraw(std::any sender, EventArgs *e);

    public:
        void Cancel();

    };
}
